package com.itheima.info.system.manager.entry;

import com.itheima.info.system.manager.controller.IBaseStudentController;
import com.itheima.info.system.manager.controller.IBaseTeacherController;
import com.itheima.info.system.manager.factory.Factory;

import java.util.Scanner;

public class SystemEntry {
    private static IBaseStudentController studentController = Factory.getStudentController();
    private static IBaseTeacherController teacherController = Factory.getTeacherController();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //系统界面开始运行 用户选择序号进行互动
        while (true) {
            System.out.println("---------欢迎来到黑马管理系统-------------");
            System.out.println("\t1.学生管理\t2.教师管理\t3.退出系统");
            System.out.print("\t您的选择:");
            int choice = sc.nextInt();
            switch (choice) {
                case 1:
                    studentController.start();
                    break;
                case 2:
                    teacherController.start();
                    break;
                case 3:
                    System.out.println("\t感谢使用");
                    System.exit(0);
                default:
                    System.out.print("\t您的输入有误,请重新输入:");
                    break;
            }
        }
    }
}
